<?php
$con=mysql_connect("sql307.freevnn.com",'freev_11941239','khoaluan');
mysql_select_db("freev_11941239_kfc",$con);	
mysql_set_charset('utf8',$con);
if(isset($_GET['id'])){
	$id=$_GET['id'];
	if($id==0){
		$sql="select * from type";
		$query=mysql_query($sql);
		echo "<div class='clr'>";
		while($data=mysql_fetch_assoc($query)){
			echo "<div class='allmenu'>";
			echo "<a href='index.php?page=menu&id=$data[type_id]'> <img src='banner/table.jpg' width='175px' height='150px'/><p class='price'>$data[type_name]</p></a>";
			echo "</div>";
			
		}
		echo "</div>";
	}else{
		$sql="select * from menu where type_id='$id'";
		$query=mysql_query($sql);
		echo "<div class='clr'>";
		if(mysql_num_rows($query)>0){
			while($data=mysql_fetch_assoc($query)){	
				$price=number_format($data["price"],0,'.',',');
				echo "<div class='allmenu'>";
				echo "<p class='name'>$data[name]</p><img src='img/$data[image]' width='175px' height='150px' /><p class='price'>Giá: $price VNĐ</p>"; 
				echo "</div>";
			}
		}else{
			echo "<p class='price'>Chưa có món này</p>";
		}
		echo "</div>";
	}
}

?>
